package com.thkj.service.impl;

import dp.dao.PagingList;
import com.thkj.framework.base.BaseService;
import com.thkj.service.TblTownService;
import com.thkj.entity.TblTown;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

@Service
public class TblTownServiceImpl extends BaseService implements TblTownService {
    public void insertTblTown(TblTown t){
        dao.insert("com.thkj.mapper.TblTown.insert", t);
    }

    public int updateTblTown(TblTown t){
        int row = dao.update("com.thkj.mapper.TblTown.update", t);
        return row;
    }

    public int deleteTblTown(String t ){
        return dao.delete("com.thkj.mapper.TblTown.delete", t);
    }

    public TblTown getTblTownById(String t){
        return dao.queryForObject("com.thkj.mapper.TblTown.getById", t, TblTown.class);
    }

	@Override
	public PagingList<Map> query(int pageIndex, int pageSize, Map<String, Object> param) {
		return dao.queryForPagingList("com.thkj.mapper.TblTown.query",param, pageIndex, pageSize, Map.class);
	}

	/**
	 * 区域（区镇DTO）
	 */
	public List<Map> queryRegion() {
		return dao.queryForList("com.thkj.mapper.TblTown.queryRegion", null, Map.class);
	}
	
	
}